package file;

import java.io.File;
import java.util.Scanner;

public class ScannerDemo2 {
    public static void main(String[] args) {
        File file = new File("D:/temp/hello.txt");
        try(Scanner scanner = new Scanner(file)){
            while (scanner.hasNext()){
                System.out.println(scanner.nextLine());
            }
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
